<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>找回密码</title>
	<meta name="keywords" content="翻倍花，O2O，第三方推广，服务平台">
    <meta name="description" content="翻贝网致力于打造国内最具公信力的第三方推广和服务平台">
    <link rel="stylesheet" href="{{env('CSS_DOMAIN')}}css/console.css">
    <style>
		#bg_pic{position: absolute;top: 0;left: 0;width: 100%;}
		.forget_outer{background: url({{env('IMAGE_DOMAIN')}}images/console/forget_bg.png) 0 0 no-repeat;position: absolute;width: 570px;height: 550px;top: 50%;left: 50%;margin-top: -275px;margin-left: -320px;padding-left: 20px;}
		.forget_top{margin-top: 80px;text-align: center;}
		#forget_con{margin-left: 45px;}
		#forget_con .forget_user{width: 476px;height: 46px;border: 2px solid #a4a4a4;border-radius: 10px;font-size: 18px;color: #a4a4a4;padding-left: 20px;margin-top: 20px;}
		#forget_con .forget_yanz{width: 336px;height: 46px;border: 2px solid #a4a4a4;border-radius: 10px;font-size: 18px;color: #a4a4a4;padding-left: 20px;margin-top: 20px;}
		#forget_con .forget_check{overflow: hidden;width: 500px;margin-top: 30px;height: 50px;line-height: 50px;}
		#forget_con .forget_check .forget_checkbox{float: left;width: 16px;height: 16px;border: 2px solid #cccccc;border-radius: 5px;margin-right: 20px;margin-top: 16px;background: url(index_down_p.png) 0 0 no-repeat;}
		#forget_con .forget_btnyz{width: 130px;height: 30px;border: 2px solid #a86ad0;color: #a86ad0;font-size: 18px;margin-top: 20px;border-radius: 5px;background-color: #f5f5f5;cursor: pointer;display: inline-block;line-height: 30px;text-align: center;}
		#forget_con .forget_check .forget_btn{float: right;width: 140px;height: 50px;border-radius: 5px;background-color: #a86ad0;color: #fff;font-size: 18px;}
    </style>
</head>
<body>
	<img id="bg_pic" src="{{env('IMAGE_DOMAIN')}}images/console/login_bg.png" alt="">
	<div class="forget_outer">
		<div class="forget_top">
			<span class="fz_28 co_gray56" style="font-weight: bold;">翻贝网后台管理系统</span>
		</div>
		<form method="" action="" id="forget_con">
			<input class="forget_user" style="margin-top: 30px;" type="text" name="mobile" value="" placeholder="请输入手机号"><br>
			<input class="forget_yanz" type="text" name="code" value="" placeholder="请输入验证码">
			<span class="forget_btnyz" id="get_code">获取验证码</span>
			<input class="forget_user" type="password" name="password" value="" placeholder="请输入6-18位密码"><br>
			<input class="forget_user" type="password" name="password_confirm" onblur="confirm_password();" value="" placeholder="请确认密码">
			<div class="forget_check">
				<a href="/console/login"><span class="fl fz_18 co_gray81">返回登录></span></a>
				<input class="forget_btn" type="button" name="submit_password" value="提交">
			</div>
		</form>
		<span id="message"></span>
	</div>
	<script src="{{env('JS_DOMAIN')}}js/jquery-1.11.1.min.js?v={{env('JS_VERSION')}}"></script>
	<script>
        var wh=$(window).height();
        window.onresize=function (){
            wh=$(window).height();
            $('#bg_pic').height(wh);
        }
		function countdown(id,seconds){
			var timer = setInterval(function(){
				seconds = seconds-1;
				if(seconds >= 0){
					$(id).html(seconds + '秒');
				}else{
					on_off = 'on';//60秒内不能点击的开关
					$(id).html('重新获取');
					clearInterval(timer);
				}
			},1000);
		};
		var on_off = 'on';
		$("#get_code").click(function(){
		    var mobile = $("input[name='mobile']").val();
		    if(mobile == '') {
                $('#message').text('手机号码不能为空');
		    } else {
		    	if(on_off == 'on'){
					countdown("#get_code",60);
		    		$('#message').text('');
	                $.ajax({
	                    url:"/console/captcha/get",
	                    data:{
	                        'mobile':mobile
	                        },
	                    async:false
	                });
	                on_off = 'off'
		    	};
            }
		});
		function confirm_password() {
		    var password = $("input[name='password']").val();
		    var password_confirm = $("input[name='password_confirm']").val();
		    if(password != password_confirm) {
		        $('#message').text('两次密码不一致');
		        return;
		    } else {

		    }
		}
		$("input[name='submit_password']").click(function() {
		    $.ajax({
                url:"/console/password/forget/submit",
                data:$('form').serialize(),
                async:false,
                dataType:'json',
                type:'post',
                success:function(data){
                    if(data.status == 'success') {
                        alert(data.message);
                        window.location.href="/console/login";
                    } else {
                        alert(data.message);
                    }
                }
            });
		});
	</script>
</body>
</html>